<!--#include virtual="/common/Config.asp" -->
<!--#include virtual="/common/conn.asp" -->
<!--#include virtual="/common/function.asp" -->
<%
Dim FM_ID	
Dim Big_ID
Dim Corp_City_Area
Dim City_ID
Dim Corp_Name
Dim Corp_Pic
Dim Corp_Detail		
Dim Corp_Tel		
Dim Corp_Fax		
Dim Corp_Address
Dim Corp_Address_S
Dim Corp_Open		
Dim Corp_Business	
Dim Corp_SI
Dim Corp_Username
Sub Get_Corp_Info()

	fm_id = Requery("fm_id")

	Call Check_IsNumeric(fm_id)

	Sql = "SELECT * FROM Corp_Info WHERE ID="&fm_id


	Set rs = conn.execute(sql)
	
	If Not rs.eof Then
		Corp_City_Area	= rs("Corp_City_Area") 
		Corp_Type       = rs("Corp_Type")
		Corp_Name		= rs("Corp_Name")
		Corp_Pic		= rs("Corp_Pic")
		Corp_Detail		= rs("Corp_Detail")
		Corp_Tel		= rs("Corp_Tel")
		Corp_Fax		= rs("Corp_Fax")
		Corp_Address	= rs("Corp_Address")
		Corp_Address_S	= rs("Corp_Address_S")
		Corp_Open		= rs("Corp_Open")
		Corp_Business	= rs("Corp_Business")
		Corp_SI			= rs("Corp_SI")
		Corp_Username	= rs("Corp_Username")					   
		Update_Name    = rs("Update_Name")
		Update_Date    = rs("Update_Date")

	End If

End Sub 
Sub Save_Comment()
	If Comment_Add() = True Then  
		alertBox "点评成功!","family_detail.asp?fm_id="&reform("fm_id")&"#N-C"
	Else
		alertBox "请输入正确的信息!","javascript:history.go(-1)"
	End If

End Sub 
Function Comment_Add()
	comment_content = encode_html(reform("comment_content"))
	fm_id = reform("fm_id")
	comment_item  = reform("comment_item1")
	comment_item1 = reform("comment_item2")
	comment_item2 = reform("comment_item3")
	comment_item3 = reform("comment_item4")

	If session("username")="" Then 
		username = "游客"
	Else
		username = 	session("username")
	End If 

	sql = "INSERT INTO Corp_Comments( " &_
			" Corp_ID"&_			
			",UserName"&_		
			",Comment"&_			

			",Comment_Item"&_	
			",Comment_Item1"&_	
			",Comment_Item2"&_	
			",Comment_Item3"&_	

			",Update_Date"&_		
			") VALUES( " &_


			" "&fm_id&_			
			",'"&UserName&"'"&_		
			",'"&comment_content&"'"&_			

			",'"&Comment_Item&"'"&_	
			",'"&Comment_Item1&"'"&_	
			",'"&Comment_Item2&"'"&_	
			",'"&Comment_Item3&"'"&_	

			",'"&Now()&"'"&_	
			")"
		'On Error Resume Next
		conn.execute(sql)

		If Err.Number<>0  Then
			Comment_Add=False
		Else
			Err.Clear
			Comment_Add = True
		End If 

End Function 
Sub Get_Comments_Icon(Comment_Item)
	For xx=1 To Comment_Item
		Response.Write "<img src=""images/IMG/k_y.gif"" />"
	Next
	For xx=1 To 5-Comment_Item
		Response.Write "<img src=""images/IMG/k_w.gif"" />"
	Next
End Sub 
Sub Hot_Corp_List()
	Sql = "SELECT  TOP 8 b.ID,b.Corp_Name,b.Corp_Pic FROM uvw_Sort_Info a INNER JOIN Corp_Info b ON a.Info_ID = b.ID  WHERE  a.Sort_Sub_Name='热点家政企业' ORDER  BY a.Sort_Order ASC"
	Info_List = GetRsRows(Sql)
	If IsArray(Info_List) Then 
		For i=0 To UBound(Info_List,2)
			ID		   = Info_List(0,i)
			Corp_Name  = Info_List(1,i)
			Corp_Pic   = Info_List(2,i)
			If Corp_Pic="" Or IsNull(Corp_Pic) Then 
				Corp_Pic = "/images/none.png"
			End If 
			detail_url		= "family_detail.asp?fm_id="&ID
			Response.Write "<li><a href="""&detail_url&""" target=""_blank""><img src="""&Corp_Pic&""" width=130 height=88/></a>"
			Response.Write "<p class=""n""><a href="""&detail_url&""" target=""_blank"">"&Corp_Name&"</a></p>"

		Next 
	
	End If 

End Sub 
Sub Corp_Sale_News_List()
	Sql = "SELECT  TOP 20 b.ID,b.News_Title,b.UserName FROM uvw_Sort_Info a INNER JOIN Corp_Sale_News b ON a.Info_ID = b.ID  WHERE  a.Sort_Sub_Name='频道优惠信息' ORDER  BY a.Sort_Order ASC"
	Info_List = GetRsRows(Sql)
	If IsArray(Info_List) Then 
		For i=0 To UBound(Info_List,2)
			News_Title = Info_List(1,i)
			UserName   = Info_List(2,i)	
			fm_id = get_firstvalue("SELECT ID FROM Corp_Info WHERE Corp_Username='"&UserName&"'")
			detail_url		= "family_detail.asp?fm_id="&fm_id&"#N-D"
			Response.Write "<li><a href="""&detail_url&""">·"&News_Title&"</a></li>"
		Next 
	
	End If 

End Sub

'显示家政家政动态 和 政策法规
Sub Get_News_List(Info_Type_Name,Info_Count)
	Sql = "SELECT  TOP "&Info_Count&" b.Info_ID,b.Info_Title,b.Info_Pic,b.Update_Date,b.IT_Name,b.Info_Sub_Title FROM uvw_Sort_Info a INNER JOIN uvw_News b ON a.Info_ID = b.Info_ID  WHERE  a.Sort_Sub_Name='"&Info_Type_Name&"' ORDER  BY a.Sort_Order ASC"
	Info_List = GetRsRows(Sql)
	If IsArray(Info_List) Then 
		For i=0 To UBound(Info_List,2)
			news_id		= Info_List(0,i)
			news_title  = Info_List(1,i)
			news_Pic	= Info_List(2,i)
			Update_Date = Info_List(3,i)
			Info_Sub_Title = Info_List(5,i)

			news_detail_url = "/news/news_view.asp?Info_ID="&news_id

			Response.Write "<li><a href="""&news_detail_url&""">"&news_title&"</a></li>"

		Next 
		Response.Write "	</ul>"
	
	End If 
End Sub 
Sub Get_JZXT_List(Info_Type_Name,Info_Count)
	Sql = "SELECT  TOP "&Info_Count&" b.Info_ID,b.Info_Title,b.Info_Pic,b.Update_Date,b.IT_Name,b.Info_Sub_Title FROM uvw_Sort_Info a INNER JOIN uvw_News b ON a.Info_ID = b.Info_ID  WHERE  a.Sort_Sub_Name='"&Info_Type_Name&"' ORDER  BY a.Sort_Order ASC"
	Info_List = GetRsRows(Sql)
	If IsArray(Info_List) Then 
		For i=0 To UBound(Info_List,2)
			news_id		= Info_List(0,i)
			news_title  = cutstr(Info_List(1,i),27)		
			news_Pic	= Info_List(2,i)
			Update_Date = Info_List(3,i)
			news_date	= Right("0"&Month(Update_Date),2)&"-"&Right("0"&day(Update_Date),2)
			IT_Name		= Info_List(4,i)
			Info_Sub_Title = Info_List(5,i)

			news_detail_url = "/news/news_view.asp?Info_ID="&news_id

			Response.Write "<li><a href="""&news_detail_url&""">"&IT_Name&"</a> | <a href="""&news_detail_url&""">"&news_title&"</a></li>"
		Next 
	
	End If 
End Sub 

Sub Corp_List()
	Sql = "SELECT  TOP 8 b.ID,b.Corp_Name,b.Corp_Pic,b.Corp_SI FROM uvw_Sort_Info a INNER JOIN Corp_Info b ON a.Info_ID = b.ID  WHERE  a.Sort_Sub_Name='频道家政企业' ORDER  BY a.Sort_Order ASC"
	Info_List = GetRsRows(Sql)
	If IsArray(Info_List) Then 
		For i=0 To UBound(Info_List,2)
			ID		   = Info_List(0,i)
			Corp_Name  = Info_List(1,i)
			Corp_Pic   = Info_List(2,i)
			Corp_SI	   = Get_Service_Item(Info_List(3,i))
			If Corp_Pic="" Or IsNull(Corp_Pic) Then 
				Corp_Pic = "/images/none.png"
			End If 
			detail_url		= "family_detail.asp?fm_id="&ID
			Response.Write "<li><a href="""&detail_url&""" target=""_blank""><img src="""&Corp_Pic&""" width=116 height=64/></a>"
			Response.Write "<p class=""n""><a href="""&detail_url&""" target=""_blank"">"&Corp_Name&"</a></p>"
			Response.Write "<p class=""n"">服务:"&Corp_SI&"</p></li>"

		Next 
	
	End If 

End Sub 
Function Get_Service_Item(Corp_SI)
	If IsNull(Corp_SI) Or Corp_SI="" Then 
		Get_Service_Item=""
	End If 
	Array_List = GetRsRows("SELECT ID,SI_Name FROM Corp_Service_Item WHERE ID IN ("&Corp_SI&") ORDER BY SI_Order ASC ")
	If IsArray(Array_List) Then 
		For i=0 To UBound(Array_List,2)
			If i=0 Then 
				Corp_SI_S = Array_List(1,i)
			Else
				Corp_SI_S = Corp_SI_S&","&Array_List(1,i)
			End If 
		Next 
	End If 
	Get_Service_Item = Corp_SI_S
End Function 
Sub JZNS_List()
	Sql = "SELECT  TOP 12 b.UserName,c.TrueName,c.Photo,c.Age FROM uvw_Sort_Info a INNER JOIN Member b ON a.Info_ID = b.UserID  INNER JOIN Member_Personal c ON b.UserName=c.UserName WHERE  a.Sort_Sub_Name='频道家政能手' ORDER  BY a.Sort_Order ASC"
	Info_List = GetRsRows(Sql)
	If IsArray(Info_List) Then 
		For i=0 To UBound(Info_List,2)
			UserName  = Info_List(0,i)
			TrueName  = Info_List(1,i)
			Photo     = Info_List(2,i)
			Age	      = Info_List(3,i)
			If Photo="" Or IsNull(Photo) Then 
				Photo = "/images/none.png"
			End If 
			detail_url		= "family_detail.asp?fm_id="&ID
			detail_url = "#"
			Response.Write "<li><a href="""&detail_url&"""><img src="""&Photo&""" width=62 height=70/></a><p><a href=""#"">"&TrueName&"</a></p><p>年龄:"&Age&"<br />保姆能手</p></li>"

		Next 
	
	End If 

End Sub 
Sub GQ_List()
'   Sql = "SELECT  TOP 8 b.ID,b.Info_Type,b.Info_Title FROM uvw_Sort_Info a INNER JOIN Member_Info b ON a.Info_ID = b.ID  WHERE  a.Sort_Sub_Name='家政供求信息' ORDER  BY a.Sort_Order ASC"
'	Info_List = GetRsRows(Sql)
'	If IsArray(Info_List) Then 
'		For i=0 To UBound(Info_List,2)
'			ID		   = Info_List(0,i)
'			Info_Type  = Info_List(1,i)
'			Info_Title   = Info_List(2,i)
'			detail_url		= "family_detail.asp?fm_id="&ID
'			detail_url	= ""
'			Response.Write "<li><span>["&Info_Type&"]</span> <a href="""&detail_url&""">"&Info_Title&"</a></li>"
'		Next 
'	
'	End If 
	Sql = "SELECT  TOP 8 ID,Info_Type,Info_Title FROM Member_Info ORDER  BY Info_Add_Date DESC"
	Info_List = GetRsRows(Sql)
	If IsArray(Info_List) Then 
		For i=0 To UBound(Info_List,2)
			ID		   = Info_List(0,i)
			Info_Type  = Info_List(1,i)
			Info_Title   = Info_List(2,i)
			detail_url		= "family_detail.asp?fm_id="&ID
			detail_url	= ""
			Response.Write "<li><span>["&Info_Type&"]</span> <a href="""&detail_url&""">"&Info_Title&"</a></li>"
		Next 
	
	End If 

End Sub 

%>